/**
 * @author  weigao<weiga@iflytek.com>
 *
 * @version 1.0.0
 */
package com.iflytek.uoamp.agent.monitor.dump.obj;

import com.alibaba.fastjson.JSON;
import com.iflytek.uoamp.agent.core.sender.monitorsender.monitorinterface.IItem;
import com.iflytek.uoamp.agent.core.sender.monitorsender.responseObj.RequestVersion;

import java.util.HashMap;
import java.util.Map;

public class TaskPing implements IItem {

	private String ip = null;
	private Map<String, String> proces = null;

	public TaskPing(String ip, Map<String, String> taskProces) {
		this.ip = ip;
		this.proces = taskProces;
	}

	public Map<String, String> getProces() {
		return proces;
	}

	public void setProces(Map<String, String> proces) {
		this.proces = proces;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Override
	public String caseToString() {
		return "";
	}

	@Override
	public String getSendPath() {
		return "";
	}

	@Override
	public String getSendListPath() {
		return "";
	}

	/**
	 * 获取task的ping包
	 * 
	 * <packageType>:包类型
	 * <ip>:本机的IP地址
	 * <taskProces>:任务的处理状态
	 * @return
	 */
	public RequestVersion getPingPackage() {
		RequestVersion request = new RequestVersion();
		Map<String, String> header = new HashMap<String, String>();
		header.put("packageType", "ping");
		header.put("ip", ip);
		header.put("taskProcess", JSON.toJSONString(proces));
		request.setHeaders(header);
		return request;
	}

}
